home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Atari Compendium
/
The Atari Compendium (Toad Computers) (1994).iso
/
files
/
umich
/
telecomm
/
stkr3dmo.zoo
/
stkr3dmo
/
demo.bts
< prev
next >
Wrap
Text File
|
1991-11-15
|
12KB
|
380 lines
// STalker 3 script file for disabled demo
include "stalker.bth" // definitions for built-in functions
function show_fkeys() // show function key assignments
string buffer[80];
int i;
i = 0;
repeat
set_int_param(MISC_PARAM, SHOW_CONTROL_CHARS, TRUE); // display controls
printf("fkey%02d = \"%s\"", i + 1,
get_string_param(FKEY_PARAM, i, buffer, sizeof(buffer)));
set_int_param(MISC_PARAM, SHOW_CONTROL_CHARS, FALSE);
puts("\r\n");
until (i = i + 1) >= 20;
putchar('\n');
endfunction
function show_logon(
int entry_num
) // display the automatic logon entries
int i;
int print_title;
string prompt[10];
string response[30];
print_title = TRUE;
i = 0;
repeat
get_string_param(DIALER_LOGON_PARAM, entry_num + ((DIALER_LG_PROMPT + i) << 16), prompt, sizeof(prompt));
if get_int_param(DIALER_LOGON_PARAM, entry_num + ((DIALER_LG_HIDDEN + i) << 16)) then
strcpy(response, "«Hidden»"); // it's a hidden string (password)
else
get_string_param(DIALER_LOGON_PARAM, entry_num + ((DIALER_LG_RESPONSE + i) << 16), response, sizeof(response));
endif
if prompt[0] OR response[0] then
if print_title then
puts(" Prompt Response\r\n");
puts(" --------- -----------------------------\r\n");
print_title = FALSE;
endif
set_int_param(MISC_PARAM, SHOW_CONTROL_CHARS, TRUE);
printf(" %-11.9s%s", prompt, response);
set_int_param(MISC_PARAM, SHOW_CONTROL_CHARS, FALSE);
puts("\r\n");
endif
until (i = i + 1) >= 8;
putchar('\n');
endfunction
function show_dialer() // display autodialer entries
int group;
int i;
int count;
string name[20];
string number[20];
string script[10];
i = 0;
count = 0;
repeat
get_string_param(DIALER_NAME_PARAM, i, name, sizeof(name));
get_string_param(DIALER_NUMBER_PARAM, i, number, sizeof(number));
if name[0] OR number[0] then
if (count = count+1) == 1 then // only the first time around
puts("BBS/Service Name Group Phone Number $$/Hr Limit Script\r\n");
puts("------------------- ----- ------------------- ----- ----- --------\r\n");
endif
group = get_int_param(DIALER_GROUP_PARAM, i);
if group < 0 then
group = ' ';
else
group = group + '0';
endif
get_string_param(DIALER_SCRIPT_PARAM, i, script, sizeof(script));
printf("%-23.19s%c %-19.19s %2d.%02d %2d.%02d %s\r\n",
name, group, number,
get_int_param(DIALER_COST_PARAM, i) / 100, get_int_param(DIALER_COST_PARAM, i) % 100,
get_int_param(DIALER_LIMIT_PARAM, i) / 100, get_int_param(DIALER_LIMIT_PARAM, i) % 100,
script
);
show_logon(i);
endif
until (i = i + 1) >= 30;
if count == 0 then // no entries
puts("Oh, it doesn't look like you have any dialer entries set.\r\n");
endif
endfunction
function show_modem() // show the modem configuration settings
string buf[80];
int i;
set_int_param(MISC_PARAM, SHOW_CONTROL_CHARS, TRUE);
printf("Modem Init: «%s»", get_string_param(MDM_INIT_PARAM, 0, buf, sizeof(buf)));
set_int_param(MISC_PARAM, SHOW_CONTROL_CHARS, FALSE);
puts("\r\n");
set_int_param(MISC_PARAM, SHOW_CONTROL_CHARS, TRUE);
printf(" Prefix: «%s»", get_string_param(MDM_PREFIX_PARAM, 0, buf, sizeof(buf)));
set_int_param(MISC_PARAM, SHOW_CONTROL_CHARS, FALSE);
puts("\r\n");
set_int_param(MISC_PARAM, SHOW_CONTROL_CHARS, TRUE);
printf(" Suffix: «%s»", get_string_param(MDM_SUFFIX_PARAM, 0, buf, sizeof(buf)));
set_int_param(MISC_PARAM, SHOW_CONTROL_CHARS, FALSE);
puts("\r\n");
set_int_param(MISC_PARAM, SHOW_CONTROL_CHARS, TRUE);
printf(" Hangup: «%s»", get_string_param(MDM_HANGUP_PARAM, 0, buf, sizeof(buf)));
set_int_param(MISC_PARAM, SHOW_CONTROL_CHARS, FALSE);
puts("\r\n");
i = 0;
repeat
set_int_param(MISC_PARAM, SHOW_CONTROL_CHARS, TRUE);
printf(" Connect%d: «%s»", i + 1, get_string_param(MDM_CONNECT_PARAM, i, buf, sizeof(buf)));
set_int_param(MISC_PARAM, SHOW_CONTROL_CHARS, FALSE);
puts("\r\n");
until (i = i + 1) >= 2;
i = 0;
repeat
set_int_param(MISC_PARAM, SHOW_CONTROL_CHARS, TRUE);
printf(" Fail%d: «%s»", i + 1, get_string_param(MDM_FAILURE_PARAM, i, buf, sizeof(buf)));
set_int_param(MISC_PARAM, SHOW_CONTROL_CHARS, FALSE);
puts("\r\n");
until (i = i + 1) >= 4;
printf("Use DCD: %d Use DTR: %d Character Delay: %d\r\n",
get_int_param(MDM_USE_DCD_PARAM, 0), get_int_param(MDM_USE_DTR_PARAM, 0),
get_int_param(MDM_DELAY_PARAM, 0));
endfunction
function show_path() // display STalker's file paths
string buf[256];
printf("Download Path: %s\r\n", get_string_param(PATH_PARAM, PATH_DOWNLOAD, buf, sizeof(buf)));
printf(" Script Path: %s\r\n", get_string_param(PATH_PARAM, PATH_SCRIPT , buf, sizeof(buf)));
printf(" General Path: %s\r\n", get_string_param(PATH_PARAM, PATH_GENERAL , buf, sizeof(buf)));
printf(" Scrap Path: %s\r\n", get_string_param(PATH_PARAM, PATH_SCRAP , buf, sizeof(buf)));
endfunction
function waitkey() // wait for a key to be pressed
puts( "\r\n\r\nPress any key to continue..." );
getchar();
endfunction
function show_settings() // show all of the settings
puts( "\033ETo start with, here are the function key strings:\r\n\n" );
show_fkeys();
waitkey();
puts( "\033EAnd here are your autodialer settings:\r\n\n" );
show_dialer();
waitkey();
puts( "\033EThis is the modem configuration:\r\n\n" );
show_modem();
waitkey();
puts( "\033EAnd these are the current paths:\r\n\n" );
show_path();
waitkey();
endfunction
// Test all of the possible colour combinations allowed by
// VT52 and VT100/ANSI emulations.
function show_colors()
int orig_emulation;
string s;
orig_emulation = get_emulation(); // save emulation
s = "This text is being written with the colour set to ";
set_emulation(EMUL_VT52); // force to VT-52
puts("\033E\t\t\033b1\033p VT52 Mode \033q\r\n");
printf("\033b0%sWHITE\r\n", s);
printf("\033b1%sBLACK\r\n", s);
printf("\033b2%sRED\r\n", s);
printf("\033b3%sGREEN\r\n", s);
printf("\033b4%sBLUE\r\n", s);
printf("\033b5%sCYAN\r\n", s);
printf("\033b6%sYELLOW\r\n", s);
printf("\033b7%sMAGENTA\r\n", s);
printf("\033b8%sLIGHT WHITE (LIGHT GREY)\r\n", s);
printf("\033b9%sLIGHT BLACK (GREY)\r\n", s);
printf("\033b:%sLIGHT RED\r\n", s);
printf("\033b;%sLIGHT GREEN\r\n", s);
printf("\033b<%sLIGHT BLUE\r\n", s);
printf("\033b=%sLIGHT CYAN\r\n", s);
printf("\033b>%sLIGHT YELLOW\r\n", s);
printf("\033b?%sLIGHT MAGENTA\r\n", s);
puts("\n\t\t\033b1\033p VT100/ANSI Mode \033q\r\n");
set_emulation(EMUL_VT100);
printf("\23337m%sWHITE\r\n", s);
printf("\23330m%sBLACK\r\n", s);
printf("\23331m%sRED\r\n", s);
printf("\23332m%sGREEN\r\n", s);
printf("\23333m%sYELLOW\r\n", s);
printf("\23334m%sBLUE\r\n", s);
printf("\23335m%sMAGENTA\r\n", s);
printf("\23336m%sCYAN\r\n", s);
printf("\23330m"); // Restore colour to BLACK
set_emulation(orig_emulation); // restore emulation
endfunction
// Tests the play_sound() builtin function.
function show_tunes()
string buffer[80];
puts("\033E");
while TRUE do
puts("Sound number to play (0-5, Return to exit) -> ");
if gets(buffer, sizeof(buffer)) <= 0 then
return;
endif
play_sound(atoi(buffer));
endwhile
endfunction
// Copy a file to the STalker terminal window.
function show_file(string file)
string buffer[256];
int fd;
if (fd = file_open(file, 0)) < 0 then
printf("Error %d opening '%s'\r\n", fd, file);
return;
endif
while file_gets(buffer, sizeof(buffer), fd) > 0 do